home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d16 / oriel.arc / COLBRFON.ORL < prev    next >
Text File  |  1991-07-31  |  10KB  |  479 lines

  1. {-----------------------------SHAPES.ORL---------------------------------
  2.  This program draws a variety of graphic shapes. It illustrates how you 
  3.  can control the background color, the brush color and fill pattern, 
  4.  they line pattern and color, as well as the font style and color. 
  5. ------------------------------------------------------------------------}
  6. {Maximize the window and set its caption}
  7.     SetWindow(MAXIMIZE)
  8.     UseCaption("Color, Brush, Font")
  9.  
  10. {Initialize variables}
  11.     Set Br_Red=0        {Blue brush}
  12.     Set Br_Green=0
  13.     Set Br_Blue=255
  14.     Set Br_Type=0        {Solid}
  15.  
  16.     Set Pen_Red=0        {Black pen}
  17.     Set Pen_Green=0
  18.     Set Pen_Blue=0
  19.     Set Pen_Type=0        {Solid}
  20.  
  21.     Set Font_Red=0        {Black font}
  22.     Set Font_Green=0
  23.     Set Font_Blue=0
  24.     Set Font_Type=9        {System font}
  25.  
  26.     Set B_Red=255        {White background}
  27.     Set B_Green=255
  28.     Set B_Blue=255
  29.     Set B_Type=1        {Transparent}
  30.  
  31. {Set up the menu}
  32.     SetMenu("&Brush",IGNORE,
  33.           "&Solid",        Brush_Solid,
  34.           "Diagonal &Up",    Brush_Diagonalup,
  35.           "Diagonal &Down",    Brush_Diagonaldown,
  36.           "Diagonal &Cross",    Brush_Diagonalcross,
  37.           "&Horizontal",    Brush_Horizontal,
  38.           "&Vertical",        Brush_Vertical,
  39.           "&Cross",        Brush_Cross,
  40.           "&Null",        Brush_Null,
  41.           SEPARATOR,
  42.           "&White",        Brush_White,
  43.           "&Gray",        Brush_Gray,
  44.           "&Red",        Brush_Red,
  45.           "&Yellow",        Brush_Yel,
  46.           "Gree&n",        Brush_Grn,
  47.           "&Light Blue",    Brush_Ltblu,
  48.           "&Blue",        Brush_Blue,
  49.           "&Pink",        Brush_Pink,
  50.           "Blac&k",        Brush_Black,
  51.           ENDPOPUP,
  52.         "&Pen",IGNORE,
  53.           "&Solid narrow",    Pen_Solid_Narrow,
  54.           "Solid &thick",    Pen_Solid_Thick,
  55.           "&Dash",        Pen_Dash,
  56.           "D&ot",        Pen_Dot,
  57.           "Da&sh dot",        Pen_Dashdot,
  58.           "Dash do&t dot",    Pen_Dashdotdot,
  59.           "&Null",        Pen_Null,
  60.            SEPARATOR,
  61.           "&White",        Pen_White,
  62.           "&Gray",        Pen_Gray,
  63.           "&Red",        Pen_Red,
  64.           "&Yellow",        Pen_Yel,
  65.           "Gree&n",        Pen_Grn,
  66.           "&Light Blue",    Pen_Ltblu,
  67.           "&Blue",        Pen_Blue,
  68.           "&Pink",        Pen_Pink,
  69.           "Blac&k",        Pen_Black,
  70.           ENDPOPUP,
  71.         "&Font",IGNORE,
  72.           "&Terminal",        Font_Terminal,
  73.           "R&oman",        Font_Roman,
  74.           "&Script",        Font_Script,
  75.           "&Modern",        Font_Modern,
  76.           "&Helv",        Font_Helv,
  77.           "&Courier",        Font_Courier,
  78.           "T&ms Rmn",        Font_TmsRmn,
  79.           "S&ymbol",        Font_Symbol,
  80.           "&DIGITAL",        Font_Digital,
  81.           "&System",        Font_System,
  82.            SEPARATOR,
  83.           "&White",        Font_White,
  84.           "&Gray",        Font_Gray,
  85.           "&Red",        Font_Red,
  86.           "&Yellow",        Font_Yel,
  87.           "Gree&n",        Font_Grn,
  88.           "&Light Blue",    Font_Ltblu,
  89.           "&Blue",        Font_Blue,
  90.           "&Pink",        Font_Pink,
  91.           "Blac&k",        Font_Black,
  92.           ENDPOPUP,
  93.         "Back&ground",IGNORE,
  94.           "&White",        Back_Col_White,
  95.           "&Gray",        Back_Col_Gray,
  96.           "&Red",        Back_Col_Red,
  97.           "&Yellow",        Back_Col_Yel,
  98.           "Gree&n",        Back_Col_Grn,
  99.           "&Light Blue",    Back_Col_Ltblu,
  100.           "&Blue",        Back_Col_Blue,
  101.           "&Pink",        Back_Col_Pink,
  102.           "Blac&k",        Back_Col_Black,
  103.           ENDPOPUP,
  104.         "Exit!",        Bye,
  105.           ENDPOPUP)
  106.  
  107. {Set the drawing tools}
  108. Set_Br:        {Set the brush}
  109. If Br_Type = 0 Then UseBrush(SOLID,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
  110. If Br_Type = 1 Then UseBrush(DIAGONALUP,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
  111. If Br_Type = 2 Then UseBrush(DIAGONALDOWN,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
  112. If Br_Type = 3 Then UseBrush(DIAGONALCROSS,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
  113. If Br_Type = 4 Then UseBrush(HORIZONTAL,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
  114. If Br_Type = 5 Then UseBrush(VERTICAL,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
  115. If Br_Type = 6 Then UseBrush(CROSS,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
  116.          {Else} UseBrush(NULL,Br_Red,Br_Green,Br_Blue)
  117.  
  118. Set_Pen:    {Set the pen}
  119. If Pen_Type = 0 Then UsePen(SOLID,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
  120. If Pen_Type = 1 Then UsePen(SOLID,3,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
  121. If Pen_Type = 2 Then UsePen(DASH,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
  122. If Pen_Type = 3 Then UsePen(DOT,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
  123. If Pen_Type = 4 Then UsePen(DASHDOT,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
  124. If Pen_Type = 5 Then UsePen(DASHDOTDOT,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
  125.           {ELSE} UsePen(NULL,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
  126.  
  127. Set_Font:    {Establish the font}
  128. If Font_Type = 0 Then UseFont("Terminal",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  129. If Font_Type = 1 Then UseFont("Roman",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  130. If Font_Type = 2 Then UseFont("Script",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  131. If Font_Type = 3 Then UseFont("Modern",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  132. If Font_Type = 4 Then UseFont("Helv",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  133. If Font_Type = 5 Then UseFont("Courier",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  134. If Font_Type = 6 Then UseFont("Tms Rmn",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  135. If Font_Type = 7 Then UseFont("Symbol",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  136. If Font_Type = 8 Then UseFont("DIGITAL",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
  137.             {ELSE} UseFont("System",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue)
  138.  
  139. Draw:
  140.     UseBackground(TRANSPARENT,B_Red,B_Green,B_Blue)
  141.     DrawBackground
  142.  
  143.     DrawPie(0,10,45,40,40,30,13,12)
  144.     DrawText(27,40,"Pie")
  145.     DrawChord(45,10,90,40,85,30,58,12)
  146.     DrawText(67,40,"Chord")
  147.     DrawArc(90,10,135,40,130,30,103,12)
  148.     DrawText(112,40,"Arc")
  149.     DrawLine(150,10,180,32)
  150.     DrawText(157,40,"Line")
  151.  
  152.     DrawEllipse(10,60,55,90)
  153.     DrawText(25,93,"Ellipse")
  154.     DrawRectangle(69,60,114,90)
  155.     DrawText(81,93,"Rectangle")
  156.     DrawRoundRectangle(128,60,173,90,6,6)
  157.     DrawText(133,93,"Round Rectangle")
  158.  
  159. {Wait for input}
  160.     WaitInput()
  161.  
  162. Brush_Solid:
  163.     Set Br_Type = 0
  164.     Goto Set_Br
  165.  
  166. Brush_Diagonalup:
  167.     Set Br_Type = 1
  168.     Goto Set_Br
  169.  
  170. Brush_Diagonaldown:
  171.     Set Br_Type = 2
  172.     Goto Set_Br
  173.  
  174. Brush_Diagonalcross:
  175.     Set Br_Type = 3
  176.     Goto Set_Br
  177.  
  178. Brush_Horizontal:
  179.     Set Br_Type = 4
  180.     Goto Set_Br
  181.  
  182. Brush_Vertical:
  183.     Set Br_Type = 5
  184.     Goto Set_Br
  185.  
  186. Brush_Cross:
  187.     Set Br_Type = 6
  188.     Goto Set_Br
  189.  
  190. Brush_Null:
  191.     Set Br_Type = 7
  192.     Goto Set_Br
  193.  
  194. Brush_White:
  195.     Set Br_Red = 255
  196.     Set Br_Green = 255
  197.     Set Br_Blue = 255
  198.     Goto Set_Br
  199.  
  200. Brush_Gray:
  201.     Set Br_Red = 192
  202.     Set Br_Green = 192
  203.     Set Br_Blue = 192
  204.     Goto Set_Br
  205.  
  206. Brush_Red:
  207.     Set Br_Red = 255
  208.     Set Br_Green = 0
  209.     Set Br_Blue = 0
  210.     Goto Set_Br
  211.  
  212. Brush_Yel:
  213.     Set Br_Red = 255
  214.     Set Br_Green = 255
  215.     Set Br_Blue = 0
  216.     Goto Set_Br
  217.  
  218. Brush_Grn:
  219.     Set Br_Red = 0
  220.     Set Br_Green = 255
  221.     Set Br_Blue = 0
  222.     Goto Set_Br
  223.  
  224. Brush_Ltblu:
  225.     Set Br_Red = 0
  226.     Set Br_Green = 255
  227.     Set Br_Blue = 255
  228.     Goto Set_Br
  229.  
  230. Brush_Blue:
  231.     Set Br_Red = 0
  232.     Set Br_Green = 0
  233.     Set Br_Blue = 255
  234.     Goto Set_Br
  235.  
  236. Brush_Pink:
  237.     Set Br_Red = 255
  238.     Set Br_Green = 0
  239.     Set Br_Blue = 255
  240.     Goto Set_Br
  241.  
  242. Brush_Black:
  243.     Set Br_Red = 0
  244.     Set Br_Green = 0
  245.     Set Br_Blue = 0
  246.     Goto Set_Br
  247.  
  248. Pen_Solid_Narrow:
  249.     Set Pen_Type = 0
  250.     Goto Set_Pen
  251.  
  252. Pen_Solid_Thick:
  253.     Set Pen_Type = 1
  254.     Goto Set_Pen
  255.  
  256. Pen_Dash:
  257.     Set Pen_Type = 2
  258.     Goto Set_Pen
  259.  
  260. Pen_Dot:
  261.     Set Pen_Type = 3
  262.     Goto Set_Pen
  263.  
  264. Pen_Dashdot:
  265.     Set Pen_Type = 4
  266.     Goto Set_Pen
  267.  
  268. Pen_Dashdotdot:
  269.     Set Pen_Type = 5
  270.     Goto Set_Pen
  271.  
  272. Pen_Null:
  273.     Set Pen_Type = 6
  274.     Goto Set_Pen
  275.  
  276. Pen_White:
  277.     Set Pen_Red = 255
  278.     Set Pen_Green = 255
  279.     Set Pen_Blue = 255
  280.     Goto Set_Pen
  281.  
  282. Pen_Gray:
  283.     Set Pen_Red = 192
  284.     Set Pen_Green = 192
  285.     Set Pen_Blue = 192
  286.     Goto Set_Pen
  287.  
  288. Pen_Red:
  289.     Set Pen_Red = 255
  290.     Set Pen_Green = 0
  291.     Set Pen_Blue = 0
  292.     Goto Set_Pen
  293.  
  294. Pen_Yel:
  295.     Set Pen_Red = 255
  296.     Set Pen_Green = 255
  297.     Set Pen_Blue = 0
  298.     Goto Set_Pen
  299.  
  300. Pen_Grn:
  301.     Set Pen_Red = 0
  302.     Set Pen_Green = 255
  303.     Set Pen_Blue = 0
  304.     Goto Set_Pen
  305.  
  306. Pen_Ltblu:
  307.     Set Pen_Red = 0
  308.     Set Pen_Green = 255
  309.     Set Pen_Blue = 255
  310.     Goto Set_Pen
  311.  
  312. Pen_Blue:
  313.     Set Pen_Red = 0
  314.     Set Pen_Green = 0
  315.     Set Pen_Blue = 255
  316.     Goto Set_Pen
  317.  
  318. Pen_Pink:
  319.     Set Pen_Red = 255
  320.     Set Pen_Green = 0
  321.     Set Pen_Blue = 255
  322.     Goto Set_Pen
  323.  
  324. Pen_Black:
  325.     Set Pen_Red = 0
  326.     Set Pen_Green = 0
  327.     Set Pen_Blue = 0
  328.     Goto Set_Pen
  329.  
  330. Font_Terminal:
  331.     Set Font_Type = 0
  332.     Goto Set_Font
  333.  
  334. Font_Roman:
  335.     Set Font_Type = 1
  336.     Goto Set_Font
  337.  
  338. Font_Script:
  339.     Set Font_Type = 2
  340.     Goto Set_Font
  341.  
  342. Font_Modern:
  343.     Set Font_Type = 3
  344.     Goto Set_Font
  345.  
  346. Font_Helv:
  347.     Set Font_Type = 4
  348.     Goto Set_Font
  349.  
  350. Font_Courier:
  351.     Set Font_Type = 5
  352.     Goto Set_Font
  353.  
  354. Font_TmsRmn:
  355.     Set Font_Type = 6
  356.     Goto Set_Font
  357.  
  358. Font_Symbol:
  359.     Set Font_Type = 7
  360.     Goto Set_Font
  361.  
  362. Font_Digital:
  363.     Set Font_Type = 8
  364.     Goto Set_Font
  365.  
  366. Font_System:
  367.     Set Font_Type = 9
  368.     Goto Set_Font
  369.  
  370. Font_White:
  371.     Set Font_Red = 255
  372.     Set Font_Green = 255
  373.     Set Font_Blue = 255
  374.     Goto Set_Font
  375.  
  376. Font_Gray:
  377.     Set Font_Red = 192
  378.     Set Font_Green = 192
  379.     Set Font_Blue = 192
  380.     Goto Set_Font
  381.  
  382. Font_Red:
  383.     Set Font_Red = 255
  384.     Set Font_Green = 0
  385.     Set Font_Blue = 0
  386.     Goto Set_Font
  387.  
  388. Font_Yel:
  389.     Set Font_Red = 255
  390.     Set Font_Green = 255
  391.     Set Font_Blue = 0
  392.     Goto Set_Font
  393.  
  394. Font_Grn:
  395.     Set Font_Red = 0
  396.     Set Font_Green = 255
  397.     Set Font_Blue = 0
  398.     Goto Set_Font
  399.  
  400. Font_Ltblu:
  401.     Set Font_Red = 0
  402.     Set Font_Green = 255
  403.     Set Font_Blue = 255
  404.     Goto Set_Font
  405.  
  406. Font_Blue:
  407.     Set Font_Red = 0
  408.     Set Font_Green = 0
  409.     Set Font_Blue = 255
  410.     Goto Set_Font
  411.  
  412. Font_Pink:
  413.     Set Font_Red = 255
  414.     Set Font_Green = 0
  415.     Set Font_Blue = 255
  416.     Goto Set_Font
  417.  
  418. Font_Black:
  419.     Set Font_Red = 0
  420.     Set Font_Green = 0
  421.     Set Font_Blue = 0
  422.     Goto Set_Font
  423.  
  424. Back_Col_White:
  425.     Set B_Red = 255
  426.     Set B_Green = 255
  427.     Set B_Blue = 255
  428.     Goto Draw
  429.  
  430. Back_Col_Gray:
  431.     Set B_Red = 192
  432.     Set B_Green = 192
  433.     Set B_Blue = 192
  434.     Goto Draw
  435.  
  436. Back_Col_Red:
  437.     Set B_Red = 255
  438.     Set B_Green = 0
  439.     Set B_Blue = 0
  440.     Goto Draw
  441.  
  442. Back_Col_Yel:
  443.     Set B_Red = 255
  444.     Set B_Green = 255
  445.     Set B_Blue = 0
  446.     Goto Draw
  447.  
  448. Back_Col_Grn:
  449.     Set B_Red = 0
  450.     Set B_Green = 255
  451.     Set B_Blue = 0
  452.     Goto Draw
  453.  
  454. Back_Col_Ltblu:
  455.     Set B_Red = 0
  456.     Set B_Green = 255
  457.     Set B_Blue = 255
  458.     Goto Draw
  459.  
  460. Back_Col_Blue:
  461.     Set B_Red = 0
  462.     Set B_Green = 0
  463.     Set B_Blue = 255
  464.     Goto Draw
  465.  
  466. Back_Col_Pink:
  467.     Set B_Red = 255
  468.     Set B_Green = 0
  469.     Set B_Blue = 255
  470.     Goto Draw
  471.  
  472. Back_Col_Black:
  473.     Set B_Red = 0
  474.     Set B_Green = 0
  475.     Set B_Blue = 0
  476.     Goto Draw
  477.  
  478. Bye:
  479.     End